<h1>Member</h1>

<!--<a href = "<?php echo base_url(); ?>admin/banner/add" class = "add">
  <?php echo image_asset('icon-add.png', 'admin', array('alt'=>'Add','class'=>'img_link')); ?>
  &nbsp;&nbsp;&nbsp;Add
</a>-->
<div id="member_search_frm" class = "add">
  <form id="search_form" action="" method="get">
  <input type="hidden" name="page" id="" value="1" />
  <label for="level">Level : </label>
  <select name="level" id="level">
    <option value="-1" <?php echo $level1_selected; ?>>-</option>
    <option value="0" <?php echo $level2_selected; ?>>General Supplier</option>
    <option value="1" <?php echo $level3_selected; ?>>Gold Supplier</option>
  </select>
  &nbsp;&nbsp;or&nbsp;&nbsp;
  <label for="keyword">Keyword (username,firstname,lastname,email,company name) : </label>
  <input type="text" name="keyword" id="keyword" value="<?php echo $keyword; ?>"/>
  
  <input type="submit" value="Search" />
  </form>
</div>

<div class = "page">
  <form id="page_form" action="" method="get">
  Page :
  <select name="page" id="page">
    <option value="1">1</option>
  </select>
  <input type="hidden" name="level" id="" value="<?php echo $level; ?>" />
  <input type="hidden" name="keyword" id="" value="<?php echo $keyword; ?>" />
  </form>
</div>

<div class = "clear"></div>

<table class ="list">
  <tr>
    <th scope="col" width = "120">Username</th>
    <th scope="col">Name</th>
    <th scope="col" width = "180">Email</th>
    <th scope="col" width = "180">Company Name</th>
    <th scope="col" width = "180">Company Email</th>
    <th scope="col" >Level</th>
    <th scope="col" width = "85">User Approve</th>
    <th scope="col" width = "85">Email Comfirm</th>
    <th scope="col" width = "95">Website Approve</th>
    <th scope="col" width = "50">Edit</th>
    <th scope="col" width = "50">Delete</th>
  </tr>
<?
 foreach ($lists as $v) {
?>
  <tr>
    <td><?php echo $v['username']; ?></td>
    <td><?php echo $v['name']; ?></td>
    <td><?php echo $v['email']; ?></td>
    <td><?php echo $v['c_name']; ?></td>
    <td><?php echo $v['c_email']; ?></td>
    <td><?php echo $v['level']; ?></td>
    <td><a href = "<?php echo base_url(); ?>admin/member/approve/<?php echo $v['id']; ?>" class = "btn"><?php echo $v['approve']; ?></a></td>
    <td><a href = "<?php echo base_url(); ?>admin/member/status/<?php echo $v['id']; ?>" class = "btn"><?php echo $v['status']; ?></a></td>
    <td><?php echo $v['w_approve']; ?></td>
    <td><a href = "<?php echo base_url(); ?>admin/member/edit/<?php echo $v['id']; ?>" class = "btn">edit</a></td>
    <td><a href = "<?php echo base_url(); ?>admin/member/del/<?php echo $v['id']; ?>/<?php echo $v['c_id']; ?>" class = "btn" onClick = "return confirmSubmit()">delete</a></td>
  </tr>
<?
  }
?>
</table>
<style>
  .tech_img{
    width:70px;
  }
  #member_search_frm{
    padding:0;
  }
  .gold{
    color:#000000;
    background:gold;
    padding:0 2px;
  }
</style>
<script>
  $(document).ready(function(){
    $('#page').live('change',function(){
      $('#page_form').submit();
    });
  })
</script>